from typing import *


class Solution:
    def getLucky(self, s: str, k: int) -> int:
        for i in range(26):
            s = s.replace(chr(ord('a') + i), str(i + 1))
        for i in range(k):
            s = str(sum(map(int, list(s))))
        return int(s)
